package com.yzcrm.erp.crm.common;

public enum ProductEnum {
    /**
     * Product Enum
     */
    PRODUCT_TYPE_PSI("psi",0,"进销存（对内）","NULL"),
    PRODUCT_TYPE_CRM("crm",1,"商机（对外）","NULL"),
    PRODUCT_TYPE_ALL("all",2,"通用","NULL"),

    CRM_NULL("NULL",0,"NULL","NULL")
    ;

    private final String name;
    private final int  type;
    private final String remarks;
    private final String num; //编码前缀
    ProductEnum(String name, int type, String remarks, String num) {
        this.name = name;
        this.type = type;
        this.remarks = remarks;
        this.num = num;
    }
    public static ProductEnum parse(int type) {
        for (ProductEnum Enum : ProductEnum.values()) {
            if (Enum.getType()==type) {
                return Enum;
            }
        }
        return CRM_NULL;
    }

    public static ProductEnum parse(String name) {
        for (ProductEnum Enum : ProductEnum.values()) {
            if (Enum.getName().equals(name)) {
                return Enum;
            }
        }
        return CRM_NULL;
    }

    public String getName() {
        return name;
    }

    public int getType() {
        return type;
    }

    public String getRemarks() {
        return remarks;
    }
    
    public String getNum() {
        return num;
    }

}
